package cn.iocoder.yudao.module.infra.framework.security.config;

import cn.iocoder.yudao.module.infra.framework.security.core.UriSecurityInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class UriSecurityWebConfiguration implements WebMvcConfigurer {

    @Resource
    private UriSecurityConfig uriSecurityConfig;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UriSecurityInterceptor(uriSecurityConfig)).addPathPatterns("/**").order(3);
    }
}
